package com.example.demo.common.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.example.demo.common.entity.User;
import com.example.demo.common.mapper.UserMapper;
import com.example.demo.common.service.UserService;
import com.example.demo.common.util.UserUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author weifucheng
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    UserMapper userMapper;

	@Override
	public List<User> selectBySeachParam(Map<String, Object> searchParam, Page<User> page) {
		// TODO Auto-generated method stub
		String sql=UserUtil.getUserSql(searchParam);
		return userMapper.selectBySeachParam(sql, searchParam, page);
	}

	@Override
	public List<User> selectBySeachParam(Map<String, Object> searchParam) {
		// TODO Auto-generated method stub
		String sql=UserUtil.getUserSql(searchParam);
		System.out.println(sql);
		return userMapper.selectBySeachParam(sql, searchParam);
	}
}
